package com.yx.cloud.utils;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;

/**
 * Created by liunianhe on 2016/11/14.
 */
public class VersionUtils {

    public static String getClientVersion(Context context){
        String dVersion;
        PackageInfo pi = null;
        try {
            pi = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
        dVersion = pi.versionName;
        return dVersion;
    }
}
